Skip to content

policies/coding-style.md: move "defined" to other function-like things#114

Closed
esyr wants to merge 1 commit into
openssl:masterfrom
esyr:esyr/defined
Closed

policies/coding-style.md: move "defined" to other function-like things#114
esyr wants to merge 1 commit into
openssl:masterfrom
esyr:esyr/defined

Conversation

@esyr

@esyr esyr commented Aug 11, 2025

Copy link
Copy Markdown
Member

While "defined" is indeed a unary preprocessor operator, it is treated as a function sintactically in the codebase, similar to sizeof and friends.

@levitte

levitte commented Aug 11, 2025

Copy link
Copy Markdown
Member

I think it should be mentioned that defined is a preprocessor operator and not a C keyword, for clarity

@esyr

esyr commented Aug 12, 2025

Copy link
Copy Markdown
Member Author

Not sure how to do it, the whole paragraph avoids mentioning the kind of the entities it discusses (and alignof and __attribute__ are not keywords anyway), what would you suggest?

@levitte

levitte commented Aug 12, 2025

Copy link
Copy Markdown
Member

Hmmm, I've understood alignof and __attribute__ as nonstandard C language keywords, just like sizeof. https://cppreference.com/w/c/keyword.html does at least refer to alignof as a keyword in C23.

defined is solely a preprocessor keyword, i.e. it's not at all defined in the C language proper.

I'll try to propose something.

Comment thread policies/coding-style.md Outdated
While "defined" is indeed a unary preprocessor operator, it is treated
as a function sintactically in the codebase, similar to sizeof
and friends.

Co-Authored-by: Richard Levitte <levitte@openssl.org>
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
@levitte levitte added the minor edit The policy change is a minor edit not requiring vote label Aug 14, 2025
@t8m t8m added the accepted The policy change proposal was accepted by an OTC vote label Jun 25, 2026
@t8m

t8m commented Jun 25, 2026

Copy link
Copy Markdown
Member

Merged. Thank you.

@t8m t8m closed this Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accepted The policy change proposal was accepted by an OTC vote minor edit The policy change is a minor edit not requiring vote

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants